﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using DataMappers;
using ExaminationTT.Model;

namespace ConcreteMappersAndObjects.DomainObjects
{
    public class Teacher : DomainObject<int, Teacher> , ITeacher
    {
        private string _name;
        private IEnumerable<TeacherClassCUnit> _tccu;
        protected override Teacher Self()
        {
            return this;
        }

        public Teacher()
            : base()
        { }

        public Teacher(int id, string name, IEnumerable<TeacherClassCUnit> tccu) : base(id)
        {
            _name = name;
            _tccu = tccu;
        }

        #region ITeacher Members


        public string Name
        {
            get { return _name; }
            set { _name = value; MarkDirty(); }
        }

        public IEnumerable<TeacherClassCUnit> ClassCUnit
        {
            get { return _tccu.ToList(); }
        }

        #endregion

        #region ITeacher Members

        string ITeacher.Name
        {
            get { return _name; }
        }

        IEnumerable<ITeacherClassCUnit> ITeacher.ClassCUnit
        {
            get { return _tccu.ToList(); }
        }

        #endregion
    }
}
